﻿package com.liangzhong.model.task.vo
{
	import com.liangzhong.constants.TaskConst;
	/**
	 *任务描述vo 
	 * @author lake
	 * 
	 */	
    public class TaskDescVo
    {
		/**
		 *类型 
		 */		
        public var type				:int;
		/**
		 *状态 
		 */		
        private var _taskState		:int;
		/**
		 *奖励脚本 
		 */		
		public var awardScript		:String;
		/**
		 *任务名字 
		 */		
        public var taskName			:String;
		/**
		 *任务目标 
		 */		
        public var taskTarget		:String;
		/**
		 *任务描述文字 
		 */		
        public var taskDesc			:String;
		/**
		 *任务trail 
		 */		
        public var taskTrail		:String;
		/**
		 *任务奖励说明 
		 */		
        public var taskAwardTxt		:String;
		/**
		 *奖励描述 
		 */		
		public var awardDesc		:String;
		/**
		 *要求描述 
		 */		
		public var demandDesc		:String;
		/**
		 *要求 
		 */		
        public var demand			:TaskDemandVo;
		/**
		 *奖励 [物品id] 
		 */		
        public var awards			:Array = [];

        public function TaskDescVo()
        {
			demand = new TaskDemandVo();
        }
		
		public function set taskState(value :int):void
		{
			_taskState = value;
		}
		
		public function get taskState():int
		{
			if(demand.current >= demand.target)
			{
				_taskState = TaskConst.TASK_STATUS_COMPLETE;
			}
			else
			{
				_taskState = TaskConst.TASK_STATUS_NO_DONE;
			}
			return _taskState;
		}
    }
}
